<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <script src='JS/three.js'></script>
    </head>
    <body  onload="init()">
        <canvas id="mainCanvas" width="400px" height="300px" ></canvas>
				<!-- 测试推送 start-->
				<!-- 测试推送 end-->
        <script>
        	function init() {
        		// 渲染器
        		var renderer = new THREE.WebGLRenderer({
				    canvas: document.getElementById('mainCanvas')
				});
				renderer.setClearColor(0x000000) // 黑色
				// 场景
        		var scene = new THREE.Scene();
        		// 照相机
        		var camera = new THREE.PerspectiveCamera(60, 4 / 3, 1, 2000);
			    camera.position.set(0, 0, 5);
			    scene.add(camera); // 万物放进场景里
			    // a cube in the scene 创建一个长宽高为 1 2 3 的长方体 背景色为红色
			    var cube = new THREE.Mesh(new THREE.CubeGeometry(1, 2, 3),
			            new THREE.MeshBasicMaterial({
			                color: 0xff0000
			            })
			    );
			    scene.add(cube);

			    // render 渲染器渲染
   				renderer.render(scene, camera);
			  }
        </script>
    </body>
</html>